home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / delphi.swg / 0201_Using MS Internet Explorer 3.0 in Delphi.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-11-29  |  1.3 KB  |  30 lines

  1.  
  2.  
  3. Topic:  Access Violation when using MS Internet Explorer 3.0 
  4. WebBrowser as an OCX in Delphi.
  5.  
  6. Problem:  When you create an OCX wrapper class in Delphi to host the
  7. Internet Explorer 3.0 HTML viewer control (named TExplorer or 
  8. TWebBrowser depending on the age of your IE installation) and use it
  9. in a Delphi app that calls the Navigate method of that OCX control, 
  10. you'll get an access violation as well as possibly ruin your whole 
  11. Win95 OLE session.
  12.  
  13. Reason:  IE 3.0 calls the IOleClientSite.GetContainer method of 
  14. Delphi's OCX wrapper implementation.  Delphi returns an error code 
  15. E_NOTIMPL, but IE 3.0 only looks for error code E_NOINTERFACE.  IE 
  16. 3.0 ignores all other error codes and plows ahead with using the 
  17. bogus interface pointer, thus the access violation occurs.
  18.  
  19. Solution:  In Delphi 2.0's OleCtrls.pas, modify method 
  20. TOleClientSite.GetContainer to return E_NOINTERFACE instead of 
  21. E_NOTIMPL as its function result.  Note that this doesn't entirely 
  22. solve the IE 3.0 error checking problem, but it at least placates it.
  23.  
  24. Important Note: Delphi Developer and Delphi C/S customers can make
  25. the change and recompile without affecting any other units.  Delphi 
  26. Desktop customers don't have the VCL source code, so they will need 
  27. an updated DCU from Borland in order to fix it.
  28.  
  29. Special Thanks:  Danny Thorpe
  30.